﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyBBS.Data.Models
{
    public class Tag
    {
        public int ID { get; set; }
        public string TagName { get; set; }
        public bool IsActive { get; set; }

        public Tag() { }

        public Tag(string tagName, bool isActive)
        {
            TagName = tagName;
            IsActive = isActive;
        }

        #region override base methods
        public override bool Equals(object obj)
        {
            if (obj is Tag)
            {
                Tag compareTo = (Tag)obj;
                return compareTo.ID == ID;
            }
            else
                return base.Equals(obj);
        }

        public override string ToString()
        {
            return TagName;
        }

        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
        #endregion
    }
}
